<?php
/**
 * Main class for extjs properties
 * @author Kirill Egorov 2011
 */
abstract class Ext_Property
{
	/*
	 * Data types constants
	 */
	const Numeric = 1;
	const Number = 1;
	const String = 2;
	const Object = 3;
	const Boolean = 4;
	
	static protected $_instances = array();
	static public $extends = 'Ext.Component';
	static public $xtype = 'component';
	
	static public function getInstance()
	{
		$class = get_called_class();
		if(!isset(self::$_instances[$class]))
			self::$_instances[$class] = new $class();
		
		return self::$_instances[$class];
	}
	/**
	 * @param string $name
	 * @return boolean
	 */
	public function isValid($name){
		return isset($this->$name);
	}
	/**
	 * Get property list
	 * @return array();
	 */
	public function getList(){
		return get_object_vars($this);
	}
	
	public function getExtend(){
		return static::$extends;
	}
	
	public function getXtype(){
		return static::$xtype;
	}
}